package com.hubu.blog.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

import java.io.Serial;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 系统权限表(支持嵌套结构) 实体类。
 *
 * @author 331126135@qq.com
 * @since 2025-06-10
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "系统权限表(支持嵌套结构)")
@Table(value = "blog_permission", schema = "db_blog")
public class Permission implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 权限ID，雪花算法生成
     */
    @Id
    @Schema(description = "权限ID，雪花算法生成")
    private Long id;

    /**
     * 权限代码(如system:user:add)
     */
    @Schema(description = "权限代码(如system:user:add)")
    private String permCode;

    /**
     * 权限名称(如添加用户)
     */
    @Schema(description = "权限名称(如添加用户)")
    private String permName;

    /**
     * 权限描述
     */
    @Schema(description = "权限描述")
    private String description;

    /**
     * 父权限ID(构建权限树)
     */
    @Schema(description = "父权限ID(构建权限树)")
    private Long parentId;

    /**
     * 权限层级(1开始)
     */
    @Schema(description = "权限层级(1开始)")
    private Integer level;

    /**
     * 状态
     */
    @Schema(description = "状态")
    private String status;

    /**
     * 系统标识
     */
    @Schema(description = "系统标识")
    private String systemFlag;

    /**
     * 是否删除
     */
    @Column(isLogicDelete = true)
    @Schema(description = "是否删除")
    private String isDeleted;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 删除时间
     */
    @Schema(description = "删除时间")
    private LocalDateTime deleteTime;

}
